package remote.skins
{
	import flash.display.Graphics;
	
	import remote.ISelect;
	import remote.controls.Component;
	import remote.skins.brushes.SolidBrush;
	
	
	/**
	 * 多选框图标皮肤
	 * @createDate 2011-3-2
	 * @author 徐俊杰
	 */
	public class CheckBoxIconSkin extends ButtonSkin implements ISkin
	{
		public function CheckBoxIconSkin()
		{
			super();
		}
		
		
		override public function draw(target:Component):void
		{
			var brush:SolidBrush = getBrush(target);
			var g:Graphics = target.graphics;
			g.clear();
			g.lineStyle(brush.borderThickness, brush.borderColor, brush.borderAlpha);
			g.beginFill(0, 0);
			g.drawRect(0, 0, target.width, target.height);
			g.endFill();
			if((target as ISelect).selected)
			{
				g.lineStyle(2, brush.backgroundColor, brush.backgroundAlpha);
				g.moveTo(target.width / 4, target.height / 4);
				g.lineTo(target.width / 2, target.height * 3 / 4);
				g.lineTo(target.width * 5 / 4, -target.height / 4);
			}
		}
	}
}